package com.ruoyi.hotel.service.impl;

import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.hotel.domain.DishesInfo;
import com.ruoyi.hotel.mapper.DishesInfoMapper;
import com.ruoyi.hotel.service.IDishesInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-03
 */
@Service
public class DishesInfoServiceImpl implements IDishesInfoService
{
    @Autowired
    private DishesInfoMapper dishesInfoMapper;

    /**
     * 查询
     * 
     * @param id 主键
     * @return
     */
    @Override
    public DishesInfo selectDishesInfoById(String id)
    {
        return dishesInfoMapper.selectDishesInfoById(id);
    }

    /**
     * 查询列表
     * 
     * @param dishesInfo
     * @return
     */
    @Override
    public List<DishesInfo> selectDishesInfoList(DishesInfo dishesInfo)
    {
        return dishesInfoMapper.selectDishesInfoList(dishesInfo);
    }

    /**
     * 新增
     * 
     * @param dishesInfo
     * @return 结果
     */
    @Override
    public int insertDishesInfo(DishesInfo dishesInfo)
    {
        long deptId = SecurityUtils.getCurrentDeptId();
        dishesInfo.setDeptId(deptId);
        return dishesInfoMapper.insertDishesInfo(dishesInfo);
    }

    /**
     * 修改
     * 
     * @param dishesInfo
     * @return 结果
     */
    @Override
    public int updateDishesInfo(DishesInfo dishesInfo)
    {
        return dishesInfoMapper.updateDishesInfo(dishesInfo);
    }

    /**
     * 批量删除
     * 
     * @param ids 需要删除的主键
     * @return 结果
     */
    @Override
    public int deleteDishesInfoByIds(String[] ids)
    {
        return dishesInfoMapper.deleteDishesInfoByIds(ids);
    }

    /**
     * 删除信息
     * 
     * @param id 主键
     * @return 结果
     */
    @Override
    public int deleteDishesInfoById(String id)
    {
        return dishesInfoMapper.deleteDishesInfoById(id);
    }
}
